package com.jjyu.service.impl;

import com.jjyu.dao.FeedbackMapper;
import com.jjyu.entity.Feedback;
import com.jjyu.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    private FeedbackMapper feedbackMapper;

    @Override
    public boolean submitFeedback(Feedback feedback) {
        // 设置反馈时间
        feedback.setCreatedAt(LocalDateTime.now());
        feedback.setUpdatedAt(LocalDateTime.now());

        // 插入反馈到数据库
        return feedbackMapper.insert(feedback) > 0;
    }
}